Skip to content

fix(windows): prevent crashes from memory safety issues and buffer resize#46

Merged
Knightro63 merged 4 commits intoKnightro63:mainfrom
Zeisberg-GmbH:fix/windows-crash-texture
Mar 9, 2026
Merged

fix(windows): prevent crashes from memory safety issues and buffer resize#46
Knightro63 merged 4 commits intoKnightro63:mainfrom
Zeisberg-GmbH:fix/windows-crash-texture

Conversation

@Vera-Spoettl
Copy link

Summary

This PR fixes critical Windows-specific crashes in the texture handling code:

  • Fix critical memory safety issues to prevent stack buffer overrun crashes
  • Fix unused variable warning in catch block
  • Prevent stack buffer overrun crashes in texture handling with defensive bounds checking
  • Recreate FBO/RBO on buffer resize and sync dimensions to avoid partial reads and flicker

@Vera-Spoettl Vera-Spoettl mentioned this pull request Mar 8, 2026
MattVogl added 4 commits March 8, 2026 19:01
…shes

- Add input validation for texture dimensions (max 8192x8192)
- Add integer overflow protection before memory allocation
- Add null pointer validation before buffer operations
- Fix exception handling to use references instead of values
- Add OpenGL error checking before/after critical operations
- Add comprehensive bounds checking in changeSize() method
- Add memory allocation error handling with try-catch blocks

Fixes crash with Exception Code 0xC0000409 (FAST_FAIL_FATAL_APP_EXIT)
that was occurring in FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable
- Add input validation for texture dimensions (max 8192x8192)
- Add integer overflow protection before memory allocation
- Add null pointer validation before buffer operations
- Fix exception handling to use references instead of values
- Add OpenGL error checking before/after critical operations
- Add comprehensive bounds checking in changeSize() method
- Add memory allocation error handling with try-catch blocks

Fixes crash with Exception Code 0xC0000409 (FAST_FAIL_FATAL_APP_EXIT)
that was occurring in FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable
…o avoid partial reads and flicker

- Update structure.width/height in buffer mode
- Recreate framebuffer/renderbuffer when buffer size changes
- Avoid duplicate FBO creation at init (setup handled after changeSize)

Improves stability of PixelBufferTexture reads and texture updates
@Vera-Spoettl Vera-Spoettl force-pushed the fix/windows-crash-texture branch from 82d3a4a to 96a2e34 Compare March 8, 2026 18:02
@Knightro63 Knightro63 merged commit 6422601 into Knightro63:main Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants